/**
 * @Author: sxh
 * @Date: 2020/12/4
 * @Last Modified by: sxh
 * @Last Modified time: 2020/12/4
 */
const RouteView = () => import('@/layout/RouteView');
// 异步路由组件加载
const AsyncComponent = __name__ => () => import(`@/pages/${__name__}`);

// 售后服务路由
const routers = [
  {
    path: '/demandes',
    meta: {
      title: '用户诉求响应',
      icon: 'el-icon-s-cooperation'
    },
    redirect: '/demandes',
    component: RouteView,
    children: [
      {
        path: '/demandes/userDemandes',
        meta: {
          title: '诉求管理'
        },
        redirect: '/demandes/userDemandes',
        component: RouteView,
        children: [
          {
            path: '/demandes/userDemandes/register',
            meta: {
              title: '工单创建',
              keepAlive: true
            },
            component: AsyncComponent('demandes/userDemandes/register')
          },
          {
            path: '/demandes/userDemandes/fsDemands',
            meta: {
              title: '工单处理',
              keepAlive: true
            },
            component: AsyncComponent('demandes/userDemandes/fsDemands')
          },
          {
            path: '/demandes/userDemandes/demandsAll',
            meta: {
              title: '工单查询',
              keepAlive: true
            },
            component: AsyncComponent('demandes/userDemandes/demandsAll')
          }
        ]
      }
    ]
  }
];
export default routers;
